<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
let user = ref('')
user.value = 'root'
</script>

<template>
  <div class="app-container">
    <h1>日程管理系统</h1>
    
    <!-- 操作按钮区域 -->
    <div class="action-buttons">
      <div class="auth-buttons">
        <router-link to="/login">
          <button class="btn">登录</button>
        </router-link>
        <router-link to="/regist">
          <button class="btn">注册</button>
        </router-link>
      </div>
      
      <div class="user-actions">
        <span class="welcome-message">欢迎，{{user}}</span>
        <button class="btn logout-btn">退出登录</button>
        <router-link to="/showSchedule">
          <button class="btn primary-btn">查看日程</button>
        </router-link>
      </div>
    </div>
  </div>
</template>

<style scoped>
.app-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
}

h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 2rem;
  font-weight: 600;
}

.action-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8f9fa;
  padding: 1.2rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.auth-buttons {
  display: flex;
  gap: 0.8rem;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.welcome-message {
  color: #4a5568;
  font-size: 0.95rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  background-color: #e2e8f0;
  color: #334155;
}

.btn:hover {
  background-color: #cbd5e1;
  transform: translateY(-1px);
}

.primary-btn {
  background-color: #3b82f6;
  color: white;
}

.primary-btn:hover {
  background-color: #2563eb;
}

.logout-btn {
  background-color: #ef4444;
  color: white;
}

.logout-btn:hover {
  background-color: #dc2626;
}

/* 链接样式重置 */
a {
  text-decoration: none;
}
</style>
